#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
class Solution {
public:
    string makeGood(string s) {
        string ss;
        int a = 0;
        int b = a + 1;
        while (a < s.size())
        {
            if ((s[a] - 32 == s[b] || s[a] + 32 == s[b]) && b < s.size())
            {
                a = b + 1;
                b = a + 1;
                continue;
            }
            ss += s[a++];
            b = a + 1;
        }
        a = 0;
        b = a + 1;
        string sss("");
        while (a < ss.size())
        {
            if ((ss[a] - 32 == ss[b] || ss[a] + 32 == ss[b]) && b < ss.size())
            {
                a = b + 1;
                b = a + 1;
                continue;
            }
            sss += ss[a++];
            b = a + 1;
        }
        return sss;
    }
};
class Solution1{
public:
    string makeGood(string s) {
        int a = 0;
        int b = a + 1;
        while (a < s.size())
        {
            if ((s[a] - 32 == s[b] || s[a] + 32 == s[b]) && b < s.size())
            {
                s.erase(a, 2);
                a = 0;
                b = a + 1;
            }
            else
            {
                a++;
                b = a + 1;
            }
        }
        return s;
    }
};
class Solution {
public:
    set<int> s;
    void inorede(TreeNode* root)
    {
        if (root == nullptr)
        {
            return;
        }
        s.insert(root->val);
        inorede(root->left);
        inorede(root->right);
    }
    int numColor(TreeNode* root) {
        inorede(root);
        return s.size();
    }
};
int main()
{
	return 0;
}